package com.leo.common.core.exception;

import com.leo.common.core.util.MessageUtils;
import com.leo.common.core.util.SpringContextHolder;
import lombok.NoArgsConstructor;

/**
 * @description: 业务异常
 * @create: 2019-10-23 08:08
 **/
@NoArgsConstructor
public class BizException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	public BizException(String message) {
		super(SpringContextHolder.getBean(MessageUtils.class).get(message));
	}

	public BizException(Throwable cause) {
		super(cause);
	}

	public BizException(String message, Throwable cause) {
		super(SpringContextHolder.getBean(MessageUtils.class).get(message), cause);
	}

	public BizException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
		super(SpringContextHolder.getBean(MessageUtils.class).get(message), cause, enableSuppression,
				writableStackTrace);
	}

}
